<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id= "app">

        
   
    

    <a href="javascript:void(0)"@click="prev" v-show="index!=0">上一张</a>
    
    
    

    <img :src="imgArr[index]" alt="">

    <a href="javascript:void(0)" @click="next" v-show="index<imgArr.length-1">下一张</a>
    
    
    

    </div>
<script>
    var vm = new Vue({
        el:"#app",
        data:{
            imgArr:[
                "./img/lb0.jpg",
                "./img/lb1.jpg",
                "./img/lb2.jpg",



            ],
            index:0

        },
        methods:{
            prev:function(){
                this.index--;
            }, 
            next:function(){
                this.index++;

            }

        }
    })
</script>
</body>
</html>